-
-
Notifications
You must be signed in to change notification settings - Fork 83
Add IsDeadlockError #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
DbExceptionClassifier/PostgreSQL/PostgreSQLExceptionClassifier.cs
Outdated
Show resolved
Hide resolved
|
@pengweiqhca Can you fix the failing tests too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds deadlock detection and handling capabilities to the EntityFramework.Exceptions library. The changes introduce a new DeadlockException type and implement deadlock error classification across multiple database providers.
- Adds
DeadlockExceptionclass with standard constructors for Entity Framework integration - Implements
IsDeadlockErrormethod across database-specific exception classifiers (SQL Server, PostgreSQL, Oracle, MySQL) - Adds comprehensive test coverage with database-specific test overrides for platforms that don't support deadlock testing
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| EntityFramework.Exceptions/Common/Exceptions.cs | Defines the new DeadlockException class with standard EF constructors |
| EntityFramework.Exceptions/Common/ExceptionProcessorInterceptor.cs | Adds deadlock detection to the exception processing pipeline |
| EntityFramework.Exceptions/Common/ExceptionFactory.cs | Maps deadlock database errors to DeadlockException instances |
| DbExceptionClassifier/Common/IDbExceptionClassifier.cs | Adds IsDeadlockError interface method with default implementation |
| DbExceptionClassifier/*/ExceptionClassifier.cs | Implements deadlock error detection for each database provider |
| EntityFramework.Exceptions/Tests/DatabaseTests.cs | Adds deadlock test case and exposes Options property in DemoContext |
| EntityFramework.Exceptions/Tests/*Tests.cs | Overrides deadlock test for SQLite and Oracle with skip attributes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@pengweiqhca Are you sure there is no way to cause deadlock in Oracle and SQLite? |
|
SQLite does not have deadlocks. In Oracle, I was unable to reproduce a deadlock in the same scenario, even after waiting until timeout, so I skipped it. |
Fix #88